package com.shoulder.boot.acl.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shoulder.boot.acl.entity.Role;
import com.shoulder.boot.acl.entity.UserRole;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserRoleMapper extends BaseMapper<UserRole> {

    @Select("select r.* from acl_role r left join acl_user_role ur on r.id = ur.role_id where ur.user_id = #{userId}")
    List<Role> findRolesByUserId(@Param("userId") String userId);
}
